package methoddemo;

import java.util.Scanner;

public class methodTest2 {
    public static void main(String[] args) {
        /*
        需求：定义一个方法，求圆的面积，将结果在方法中进行打印
         */


        Scanner sc = new Scanner(System.in);
        System.out.println("请输入长方形的长和宽");
        getarea(sc.nextInt(), sc.nextInt());

    }


    public static void getarea(double lenth, double width) {
        double area = lenth * width;
        System.out.println("长方形的面积为" + area);
    }
}
